Skip to content

CSPL-3775 extract common code in tests#1788

Merged
kasiakoziol merged 62 commits intodevelopfrom
feature/CSPL-3775-extract-common-code-in-tests
Apr 22, 2026
Merged

CSPL-3775 extract common code in tests#1788
kasiakoziol merged 62 commits intodevelopfrom
feature/CSPL-3775-extract-common-code-in-tests

Conversation

@kasiakoziol
Copy link
Copy Markdown
Collaborator

@kasiakoziol kasiakoziol commented Mar 20, 2026

Description

It extracts common code under test/ to remove duplicates and enhance test readability and usability.

Key Changes

  • Consolidate duplicate V3 (master) and V4 (manager) test files into shared _shared.go + _test.go pairs with table-driven version configs
  • Delete ~30 redundant per-variant files (~5000 lines removed)
  • Add reusable version-aware deploy and verify helpers to the shared test utilities
  • Add watch-based verification utilities for faster and more reliable phase checks
  • Extract repeated multi-line verification patterns into shared helper functions
  • Inline single-use helpers and replace inline closures with reusable typed methods
  • Remove redundant guard clauses, double-verification calls, and dead code
  • Simplify variable declarations and replace hardcoded strings with constants
  • Fix naming conventions, add missing godoc, and standardize comments
  • Adopt shared helpers across appframework tests to reduce inline boilerplate

Testing and Verification

Automated tests

Related Issues

Jira: https://splunk.atlassian.net/browse/CSPL-4515

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

kasiakoziol and others added 29 commits March 16, 2026 07:05
* CSPL-4397 Remove time dependency from tests

* CSPL-4397 Removing test reliance on time

* CSPL-4397 Adjusting timeouts

* CSPL-4354 Fixing time dependencies in unit tests and fixing timeouts in integ tests

* CSPL-4397 Move to using watch

* CSPL-4397 Refactor pod reset detection to use UID-based tracking instead of time-based comparison, add fail-fast test prerequisites validation, and improve code clarity with variable renaming

* CSPL-4397 Refactoring

* CSPL-4397 Addressing comments
…1768)

* CSPL-4602 Moving duplicated code for LM tests to a shared codebase

* CSPL-4602 Addinf license manager tests to workflows

* CSPL-4602 Address comments

* CSPL-4602 Moving LM shared test utils to licensemanager package

* CSPL-4602 Addressing base branch changes
* CSPL-4377 Get rid of not expected panic in tests

* CSPL-4377 Check error for app disablement in tests
…nts, removing duplicate helpers, replacing inline logic with shared utilities
* Enhance error handling in WaitforPhaseChange and fix variable name in NewTestCaseEnv

* Updated WaitforPhaseChange to log an error if the phase transition is not observed within the timeout.
* Corrected the variable name check in NewTestCaseEnv to use the provided name instead of an uninitialized envName.
* Changed Kind from "ClusterManager" to "ClusterMaster" in ClusterMaster struct.

* Update error logging in WaitforPhaseChange to use Error level for timeout observations
…ode, and standardize naming, godoc comments, and constants for consistency
Comment thread test/testenv/test_workflows.go Outdated
@kasiakoziol kasiakoziol force-pushed the feature/CSPL-3775-extract-common-code-in-tests branch from a49e621 to 2926a35 Compare April 10, 2026 08:27
Comment thread test/testenv/index_ingest_separation_utils.go
Copy link
Copy Markdown
Collaborator

@kubabuczak kubabuczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Let's merge it and start iterating on top of this change

One thing to double check: Verify CI pipeline label selectors still match reformatted test labels

Base automatically changed from feature/test-refactoring to develop April 14, 2026 17:57
@kasiakoziol kasiakoziol force-pushed the feature/CSPL-3775-extract-common-code-in-tests branch from 2a29a09 to a23b897 Compare April 21, 2026 11:10
@kasiakoziol kasiakoziol force-pushed the feature/CSPL-3775-extract-common-code-in-tests branch from a23b897 to 218b792 Compare April 21, 2026 12:29
@kasiakoziol kasiakoziol merged commit 47b2a05 into develop Apr 22, 2026
78 of 79 checks passed
@kasiakoziol kasiakoziol deleted the feature/CSPL-3775-extract-common-code-in-tests branch April 22, 2026 07:51
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants